package forum.server.controller;

import java.io.Serializable;

import forum.server.domain.Post;

/**
 * A single search hit returned after a search operation.
 * 
 * @author Tomer Heber
 */
public class SearchHit implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -3044130726000149650L;
	
	private Post post;
	private double score;

	public SearchHit(Post post, double score) {
		this.post = post;
		this.score = score;
	}
	
	public double getScore() {
		return this.score;
		
	}
	
	public Post getPost() {
		return this.post;
	}
	
    @Override
	public boolean equals(Object o) {
		return (o instanceof SearchHit && ((SearchHit)o).getPost().equals(this.post));
	}

}
